#!/usr/bin/env python

""" CLASS/MODULE:
    Purpose:
"""
__author__ = 'liwei79@gmail.com'

from RTLBlock import *

ROUT_START_ID = 0

class RTLRoutine:
    def __init__(self, headCode, id):
        self.id = id
        self.headCode = headCode
        self.blocks= []

    def appendBB(self, block):
        self.blocks.append(block)

    def getHeadCode(self):
        return self.headCode

    def appendParm(self, parm):
        headCode.lst.append(parm) 
        
    def __repr__(self):
        str = "ROUT_%d:\n" % self.id
        str = str + repr(self.headCode) + "\n"
        for blk in self.blocks:
            str = str + repr(blk) + "\n"
        str = str + "\t======ROUT END======\n\n"
        return str
            
if __name__ == "__main__":
    head = CodeRout("foo", OpndLst([OpndReg("a"), OpndReg("b"), OpndReg("c")]))
    r = RTLRoutine(head, 1)
    print r
